package com.bingyuan.aipassproject.view.adapter

import com.bingyuan.aipassproject.R
import com.bingyuan.aipassproject.entity.SendRecordResponse
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder


class SendRecordAdapter : BaseQuickAdapter<SendRecordResponse.ListBean.DataBean, BaseViewHolder>(R.layout.item_send_record){
    override fun convert(holder: BaseViewHolder, item: SendRecordResponse.ListBean.DataBean) {
        holder.setText(R.id.tvTitle,item.room.title)
        holder.setText(R.id.tvUserName,item.room.title)
        holder.setText(R.id.tvDate,item.created_at)
        when(item.status){
            "finish"->{
                holder.setText(R.id.tvStatus,"已结束")
            }
            "wait"->{
                holder.setText(R.id.tvStatus,"进行中")
            }
        }
        val list = item.select_num
        var str = ""
        if (list.size==1){
             str = "雷号："+list[0]
        }else if (list.size==2){
             str = "雷号："+list[0]+","+list[1]
        }
        holder.setText(R.id.tvSelectNums,str)
//        holder.setText(R.id.tvSelectNums,str)
    }
}